//
//  GloableEngineService.h
//  iphoneTravelTour
//
//  Created by chen jiedan on 13-1-8.
//  Copyright (c) 2013年 Baidu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Koala.h"
#import <CoreLocation/CoreLocation.h>
#import "NCLocationController.h"
#import "Reachability.h"
#import "BMKSearch.h"
#import "RCLoginDataModel.h"
#import "IManager+SearchAllCity.h"
#import "RCSearchCityListDataModel.h"

@protocol GloableChoosePointDelegate <NSObject>

@optional
-(void)getPointAddress:(BMKAddrInfo*)result errorCode:(int)error;

@end

@interface GloableEngineService : NSObject<NCLocationControllerDelegate,KFNetworkDelegate,BMKSearchDelegate,IManagerDelegate>{
    BMKSearch  *_search;
}
SYNTHESIZE_SINGLETON_FOR_CLASS_HEADER(GloableEngineService);

@property (nonatomic, assign) BOOL                   mapReady;
@property (nonatomic, assign) BOOL                   GPSEnabled; //此app使用定位功能是否开通
@property (nonatomic, assign) BOOL                   networkOK;
@property (nonatomic, assign) CLLocationCoordinate2D userLocation; //用户当前位置
@property (nonatomic, retain) NSString               *userCityName;        //用户当前城市名
@property (nonatomic, retain) NSString               *selectedCityName;    //用户人工选择的城市名称
@property (nonatomic, retain) NSString               *selectedCityID;
@property (nonatomic, retain) NSString               *userCityStreetName;
@property (nonatomic, retain) NSString               *userSelectStreetName;
@property (nonatomic, assign) NetworkStatus          netWorkStatus;

@property (nonatomic, retain) CLLocation             *locationInfo;



@property (nonatomic, assign) BOOL                   hasLogin;
@property (nonatomic, copy)   NSString               *nickName;
@property (nonatomic, copy)   NSString               *userEmailName;
@property (nonatomic, copy)   NSString               *bduss;

@property (nonatomic, copy)   NSString               *shopBduss;
@property (nonatomic, copy)   NSString               *shopID;
@property (nonatomic, copy)   NSString               *shopName;
@property (nonatomic, retain) BMKSearch              *search;
@property (nonatomic, assign) id<GloableChoosePointDelegate> delegate;


- (void) updataUserLocation;
- (id) initWithDefaultLocController;


-(void) setTabbarIndex:(NSInteger)index withMessage:(NSString*)message;

- (void) setUpLoginInfo;
-(void) saveUserLoginInfo:(RCLoginDataModel *)loginInfo;
- (void) saveServerUserLoginInfo:(RCServerLoginDataModel *)loginInfo;

-(void)saveUserEmailName:(NSString *)emailName;

-(void)getUserEmailName;

-(void) cleanLoginInfo;
- (void) cleanServerLoginInfo;

-(RCSearchCityListItem *)getSavedSelectCityInfo;

// No 表示 未登录并且弹出登录框， YES 表示已经登录
- (BOOL) alertLoginViewIfUnlogin:(UIViewController *)vc;
@end
